package com.aspose.cells;

class zey {
   public static zagu a(int var0, zagu[] var1, zaay var2, int var3, int var4) {
      double[] var5 = new double[var4];
      zyz var6 = zaaq.a(var1, var2, 0, (double[])var5, var3);
      if (var6 != null) {
         return var6;
      } else {
         int var7;
         int var8;
         double var9;
         double var14;
         boolean var16;
         switch(var0) {
         case 15:
            return new zyy(Math.sin(var5[0]));
         case 16:
            return new zyy(Math.cos(var5[0]));
         case 17:
            var14 = Math.tan(var5[0]);
            if (Double.isInfinite(var14)) {
               return zze.a;
            }

            return new zyy(var14);
         case 18:
            return new zyy(Math.atan(var5[0]));
         case 20:
            if (var5[0] < 0.0D) {
               return zze.a;
            }

            return new zyy(Math.sqrt(var5[0]));
         case 21:
            var14 = Math.exp(var5[0]);
            if (Double.isInfinite(var14)) {
               return zze.a;
            }

            return new zyy(var14);
         case 22:
            if (var5[0] <= 0.0D) {
               return zze.a;
            }

            return new zyy(Math.log(var5[0]));
         case 23:
            if (var5[0] <= 0.0D) {
               return zze.a;
            }

            return new zyy(Math.log10(var5[0]));
         case 24:
            return new zyy(Math.abs(var5[0]));
         case 25:
            return new zyy(Math.floor(var5[0]));
         case 26:
            if (var5[0] < 0.0D) {
               return new zyy(-1.0D);
            } else {
               if (var5[0] > 0.0D) {
                  return new zyy(1.0D);
               }

               return new zyy(0.0D);
            }
         case 27:
            return new zyy(com.aspose.cells.a.c.zm.a(zfc.b(var5[0]), (int)var5[1]));
         case 39:
            if (Math.abs(var5[1]) < Double.MIN_VALUE) {
               return zza.a;
            } else {
               if (Math.abs(var5[0]) < Double.MIN_VALUE) {
                  return new zyy(0.0D);
               }

               var14 = var5[0] % var5[1];
               if (var14 != 0.0D && Math.signum(var5[0]) != Math.signum(var5[1])) {
                  var14 += var5[1];
               }

               return new zyy(var14);
            }
         case 65:
            if (var5[0] < 0.0D) {
               return zze.a;
            } else {
               var7 = (int)var5[0];
               if (var7 < 1900) {
                  var7 += 1900;
               }

               try {
                  DateTime var15 = DateTime.a.addYears(var7 - 1).addMonths((int)var5[1] - 1).addDays((double)((int)var5[2] - 1));
                  if (var15.getYear() >= 1900) {
                     return zaaq.a(var15, var2);
                  }
               } catch (Exception var13) {
                  ;
               }

               return zze.a;
            }
         case 66:
            var14 = (double)((int)var5[0]) + (double)((int)var5[1]) / 60.0D + (double)((int)var5[2]) / 3600.0D;
            if (var14 < 0.0D) {
               return zze.a;
            }

            var14 /= 24.0D;
            if (var14 >= 1.0D) {
               var14 -= (double)((int)var14);
            }

            return new zyy(var14);
         case 97:
            if (var5[0] == 0.0D && var5[1] == 0.0D) {
               return zza.a;
            }

            return new zyy(Math.atan2(var5[1], var5[0]));
         case 98:
            if (var5[0] <= 1.0D && var5[0] >= -1.0D) {
               return new zyy(Math.asin(var5[0]));
            }

            return zze.a;
         case 99:
            if (var5[0] <= 1.0D && var5[0] >= -1.0D) {
               return new zyy(Math.acos(var5[0]));
            }

            return zze.a;
         case 100:
            var7 = (int)var5[0];
            if (var7 >= 1 && var7 <= 255 && var7 < var1.length) {
               return var1[var7];
            }

            return zzg.a;
         case 111:
            var7 = (int)var5[0];
            if (var7 >= 1 && var7 <= 255) {
               return new zaam(Character.toString((char)var7));
            }

            return zzg.a;
         case 142:
         case 297:
            if (var5[2] == 0.0D) {
               return zza.a;
            }

            return new zyy((var5[0] - var5[1]) / var5[2]);
         case 143:
            if (var5[3] > 0.0D && var5[2] >= var5[3]) {
               return new zyy((var5[0] - var5[1]) * (var5[2] - var5[3] + 1.0D) * 2.0D / (var5[2] * (var5[2] + 1.0D)));
            }

            return zze.a;
         case 184:
            if (var5[0] < 0.0D) {
               return zze.a;
            }

            return new zyy(zbmo.b((int)var5[0]));
         case 212:
            if (var5[1] <= -309.0D) {
               return zze.a;
            }

            return new zyy(com.aspose.cells.a.c.zm.a(var5[0], (int)var5[1], true));
         case 213:
            return new zyy(com.aspose.cells.a.c.zm.a(var5[0], (int)var5[1], false));
         case 229:
            return new zyy(Math.sinh(var5[0]));
         case 230:
            return new zyy(Math.cosh(var5[0]));
         case 231:
            return new zyy(Math.tanh(var5[0]));
         case 232:
            return new zyy(Math.log(var5[0] + Math.sqrt(var5[0] * var5[0] + 1.0D)));
         case 233:
            if (var5[0] < 1.0D) {
               return zze.a;
            }

            return new zyy(Math.log(var5[0] + Math.sqrt(var5[0] * var5[0] - 1.0D)));
         case 234:
         case 283:
            if (var5[0] < 1.0D && var5[0] > -1.0D) {
               return new zyy(0.5D * Math.log((1.0D + var5[0]) / (1.0D - var5[0])));
            }

            return zze.a;
         case 271:
            if (var5[0] <= 0.0D) {
               return zze.a;
            }

            return new zyy(zabx.a(var5[0]));
         case 274:
         case 508:
            return zfe.c(var5[0], (double)((long)var5[1]));
         case 275:
         case 510:
            return zfe.a(var5[0], (double)((long)var5[1]));
         case 276:
            if (var5[0] >= 0.0D && var5[1] >= 0.0D && var5[0] >= var5[1]) {
               var7 = (int)var5[0];
               var8 = (int)var5[1];
               return new zyy(zbmo.b(var7) / (zbmo.b(var8) * zbmo.b(var7 - var8)));
            }

            return zze.a;
         case 277:
         case 512:
            if (var5[0] > 0.0D && var5[0] < 1.0D && var5[1] > 0.0D && var5[2] >= 1.0D) {
               return new zyy(zaor.a(1.0D - var5[0] * 0.5D) * var5[1] / Math.sqrt(var5[2]));
            }

            return zze.a;
         case 278:
            return zfe.a((int)var5[0], var5[1], var5[2]);
         case 279:
            var14 = var5[0];
            if (Math.abs(var14 % 2.0D) < 1.0E-14D) {
               return new zyy(var14);
            } else {
               var16 = var14 < 0.0D;
               var14 = Math.abs(var14);
               ++var14;
               var14 = Math.floor(var14);
               if (var14 % 2.0D < 1.0E-14D) {
                  return new zyy(var16 ? -var14 : var14);
               }

               return new zyy(var16 ? -var14 - 1.0D : var14 + 1.0D);
            }
         case 281:
         case 517:
            return zfe.a(var5[0], (double)((long)var5[1]), (double)((long)var5[2]), true);
         case 282:
         case 519:
            return zfe.a(var5[0], (double)((long)var5[1]), (double)((long)var5[2]));
         case 284:
            var14 = Math.exp(var5[0] * 2.0D);
            return new zyy((var14 - 1.0D) / (var14 + 1.0D));
         case 285:
            var14 = var5[0];
            var9 = var5[1];
            if (var14 == 0.0D) {
               return zyy.a;
            } else if (var9 == 0.0D) {
               return zza.a;
            } else {
               if (var14 < 0.0D) {
                  if (var9 > 0.0D) {
                     return zze.a;
                  }
               } else if (var9 < 0.0D) {
                  return zze.a;
               }

               if (var9 >= -1.0D && var9 <= 1.0D) {
                  return new zyy((double)((int)(var14 * (1.0D / var9))) * var9);
               }

               return new zyy(var5[1] * (double)((int)(var5[0] / var5[1])));
            }
         case 287:
         case 522:
            return zfe.b(var5[0], var5[1], var5[2]);
         case 288:
            var14 = var5[0];
            var9 = var5[1];
            if (var14 != 0.0D && var9 != 0.0D) {
               if (var14 > 0.0D && var9 < 0.0D) {
                  return zze.a;
               }

               return new zyy(Math.ceil(zfc.c(var14) / var9) * var9);
            }

            return zyy.a;
         case 289:
            return zfe.a(var5[0], var5[1], var5[2], var5[3]);
         case 290:
            if (var5[0] > 0.0D && var5[2] > 0.0D) {
               return new zyy(zaor.b((Math.log(var5[0]) - var5[1]) / var5[2]));
            }

            return zze.a;
         case 291:
            if (var5[0] >= 0.0D && var5[0] <= 1.0D && var5[2] > 0.0D) {
               return new zyy(Math.exp(var5[1] + var5[2] * zaor.a(var5[0])));
            }

            return zze.a;
         case 292:
            if (var5[0] >= 0.0D && var5[1] >= 0.0D && var5[2] >= 0.0D && var5[2] <= 1.0D) {
               var14 = 1.0D - var5[2];
               var9 = Math.pow(var5[2], var5[1]);

               for(double var11 = 0.0D; var11 < var5[0]; ++var11) {
                  var9 *= (var11 + var5[1]) / (var11 + 1.0D) * var14;
               }

               return new zyy(var9);
            } else {
               return zze.a;
            }
         case 294:
            return new zyy(zaor.b(var5[0]));
         case 295:
         case 501:
            if (var5[0] >= 0.0D && var5[0] <= 1.0D && var5[2] >= 0.0D) {
               return new zyy(zaor.a(var5[0], var5[1], var5[2]));
            }

            return zze.a;
         case 296:
         case 502:
            if (var5[0] > 0.0D && var5[0] < 1.0D) {
               return new zyy(zaor.a(var5[0]));
            }

            return zze.a;
         case 298:
            var14 = var5[0];
            var16 = var14 < 0.0D;
            var14 = Math.ceil(Math.abs(var14));
            if (var14 % 2.0D <= 1.0E-14D) {
               return new zyy(var16 ? -var14 - 1.0D : var14 + 1.0D);
            }

            return new zyy(var16 ? -var14 : var14);
         case 299:
            if (var5[0] >= 0.0D && var5[1] >= 0.0D && var5[0] >= var5[1]) {
               return new zyy(zfe.d(var5[0], var5[1]));
            }

            return zze.a;
         case 301:
            return zfe.a(var5[0], var5[1], (int)var5[2]);
         case 332:
         case 538:
            return zfe.b(var5[0], (double)((long)var5[1]));
         case 337:
            if (Math.abs(var5[0]) < Double.MIN_VALUE) {
               if (var5[1] < 0.0D) {
                  return zza.a;
               } else {
                  if (var5[1] > 0.0D) {
                     return new zyy(0.0D);
                  }

                  return zze.a;
               }
            } else {
               if (var5[0] < 0.0D) {
                  if (Math.abs(var5[1]) < Double.MIN_VALUE) {
                     return zyy.b;
                  }

                  if (Math.abs(var5[1]) < 1.0D) {
                     var14 = 1.0D / var5[1];
                     if (var14 % 2.0D != 0.0D) {
                        var9 = -Math.pow(-var5[0], var5[1]);
                        if (Double.isNaN(var9)) {
                           return zze.a;
                        }

                        return new zyy(var9);
                     }

                     return zze.a;
                  }
               }

               var14 = Math.pow(var5[0], var5[1]);
               if (Double.isNaN(var14)) {
                  return zze.a;
               }

               return new zyy(var14);
            }
         case 342:
            return new zyy(var5[0] * 3.141592653589793D / 180.0D);
         case 343:
            return new zyy(var5[0] * 180.0D / 3.141592653589793D);
         case 350:
            if (var5[2] == 0.0D) {
               return zza.a;
            }

            return new zyy(var5[0] * var5[3] * (var5[1] / var5[2] - 1.0D));
         case 415:
            if (var5[0] < 0.0D) {
               return zze.a;
            }

            return new zyy(zbmo.a((int)var5[0]));
         case 416:
            if (var5[0] < 0.0D) {
               return zze.a;
            }

            return new zyy(Math.sqrt(var5[0] * 3.141592653589793D));
         case 417:
            if (var5[1] == 0.0D) {
               return zza.a;
            }

            return new zyy((double)((int)(var5[0] / var5[1])));
         case 420:
            return 0 == (int)var5[0] % 2 ? zyx.a : zyw.a;
         case 421:
            return 0 != (int)var5[0] % 2 ? zyx.a : zyw.a;
         case 422:
            if (var5[0] != 0.0D && var5[1] != 0.0D) {
               if (Math.signum(var5[0]) != Math.signum(var5[1])) {
                  return zze.a;
               }

               return new zyy(var5[1] * (double)((int)(var5[0] / var5[1] + 0.5D)));
            }

            return new zyy(0.0D);
         case 424:
            if (var5[0] < 0.0D) {
               return zze.a;
            }

            return new zyy(1.0D - zev.a(var5[0]));
         case 425:
            if (var5[1] < 0.0D) {
               return zze.a;
            }

            return new zyy(zev.b(var5[0], (int)var5[1]));
         case 426:
            if (var5[1] < 0.0D) {
               return zze.a;
            }

            return new zyy(zev.d(var5[0], (int)var5[1]));
         case 427:
            if (var5[1] < 0.0D) {
               return zze.a;
            }

            return new zyy(zev.c(var5[0], (int)var5[1]));
         case 428:
            if (var5[1] < 0.0D) {
               return zze.a;
            }

            return new zyy(zev.a(var5[0], (int)var5[1]));
         case 443:
            if (var5[1] < 0.0D) {
               return zze.a;
            } else {
               var7 = (int)var5[1];
               if (var7 == 0) {
                  return zza.a;
               }

               return new zyy((double)((int)var5[0]) + var5[0] % 1.0D / (double)var7 * Math.pow(10.0D, 1.0D + (double)((int)Math.floor(Math.log10((double)var7)))));
            }
         case 444:
            if (var5[1] < 0.0D) {
               return zze.a;
            } else {
               var7 = (int)var5[1];
               if (var7 == 0) {
                  return zza.a;
               }

               return new zyy((double)((int)var5[0]) + var5[0] % 1.0D * (double)var7 / Math.pow(10.0D, 1.0D + (double)((int)Math.floor(Math.log10((double)var7)))));
            }
         case 445:
            if (var5[0] > 0.0D && var5[1] >= 1.0D) {
               var7 = (int)var5[1];
               return new zyy((Math.pow(1.0D + var5[0], 1.0D / (double)var7) - 1.0D) * (double)var7);
            }

            return zze.a;
         case 446:
            if (var5[0] > 0.0D && var5[1] >= 1.0D) {
               var7 = (int)var5[1];
               return new zyy(Math.pow(1.0D + var5[0] / (double)var7, (double)var7) - 1.0D);
            }

            return zze.a;
         case 464:
            if (var5[0] > var5[1]) {
               return zze.a;
            } else {
               var7 = (int)Math.ceil(var5[0]);
               var8 = (int)Math.ceil(var5[1]);
               if (var7 == var8) {
                  return new zyy((double)var7);
               }

               return new zyy((double)com.aspose.cells.b.a.zs.a(var2.p.t, var7, (int)var5[1]));
            }
         case 535:
            return zfe.a(var5[0], var5[1], 2);
         case 536:
            return zfe.a(var5[0], var5[1], 1);
         default:
            return null;
         }
      }
   }

   public static zagu a(int var0, zagu[] var1, zaay var2) {
      for(int var3 = 0; var3 < 3; ++var3) {
         if (var1[var3].b() == 12) {
            return zzb.a;
         }
      }

      DateTime[] var6 = new DateTime[2];
      zyz var4 = zaaq.a(var1, var2, 0, (DateTime[])var6, 7);
      if (var4 != null) {
         return var4;
      } else {
         double[] var5 = new double[1];
         var4 = zaaq.a(var1, var2, 2, (double[])var5, 7);
         if (var4 != null) {
            return var4;
         } else if (var5[0] > 0.0D && !com.aspose.cells.a.c.zk.b(var6[0], var6[1]) && var6[0].getYear() <= 9998 && !com.aspose.cells.a.c.zk.d(var6[0].addYears(1), var6[1])) {
            switch(var0) {
            case 438:
               return new zyy(zew.a(var6[0], var6[1], var5[0]));
            case 439:
               return new zyy(zew.b(var6[0], var6[1], var5[0]));
            case 440:
               return new zyy(zew.c(var6[0], var6[1], var5[0]));
            default:
               return null;
            }
         } else {
            return zze.a;
         }
      }
   }

   public static zagu b(int var0, zagu[] var1, zaay var2) {
      for(int var3 = 0; var3 < 6; ++var3) {
         if (var1[var3].b() == 12) {
            return zzb.a;
         }
      }

      double[] var7 = new double[6];
      zyz var4 = zaaq.a(var1, var2, 0, (double[])var7, 1);
      if (var4 != null) {
         return var4;
      } else if (var7[0] <= 0.0D || var7[1] <= 0.0D || var7[2] <= 0.0D || var7[3] <= 0.0D || var7[3] > var7[4] || var7[5] != 0.0D && var7[5] != 1.0D) {
         return zze.a;
      } else {
         double var5 = 0.0D;
         switch(var0) {
         case 447:
            var5 = zew.b(var7[0], var7[1], var7[2], (int)var7[3], (int)var7[4], (int)var7[5]);
            break;
         case 448:
            var5 = zew.a(var7[0], var7[1], var7[2], (int)var7[3], (int)var7[4], (int)var7[5]);
         }

         return zaaq.a(var5);
      }
   }

   public static zagu b(int var0, zagu[] var1, zaay var2, int var3, int var4) {
      double[] var5 = new double[var4];
      zyz var6 = zaaq.a(var1, var2, 0, (double[])var5, var3);
      if (var6 != null) {
         return var6;
      } else {
         boolean[] var7 = new boolean[1];
         var6 = zaaq.a(var1, var2, var4, var7);
         if (var6 != null) {
            return var6;
         } else {
            switch(var0) {
            case 273:
            case 505:
               return zfe.a((int)var5[0], (int)var5[1], var5[2], var7[0]);
            case 280:
               if (var5[0] >= 0.0D && var5[1] > 0.0D) {
                  return new zyy(var7[0] ? 1.0D - Math.exp(-var5[1] * var5[0]) : var5[1] * Math.exp(-var5[1] * var5[0]));
               }

               return zze.a;
            case 286:
            case 521:
               return zfe.c(var5[0], var5[1], var5[2], var7[0]);
            case 293:
            case 499:
               if (var5[2] <= 0.0D) {
                  return zze.a;
               }

               return new zyy(zaor.a(var5[0], var5[1], var5[2], var7[0]));
            case 300:
            case 531:
               if (var5[0] >= 0.0D && var5[1] >= 0.0D) {
                  if (var5[1] == 0.0D) {
                     return new zyy(!var7[0] && var5[0] != 0.0D ? 0.0D : 1.0D);
                  } else {
                     int var14 = (int)var5[0];
                     if (!var7[0]) {
                        return new zyy(Math.exp(-var5[1]) * Math.pow(var5[1], (double)var14) / zfe.d((double)var14, (double)var14));
                     } else {
                        double var9 = 0.0D;

                        for(int var11 = 0; var11 <= var14; ++var11) {
                           var9 += Math.exp(-var5[1]) * Math.pow(var5[1], (double)var11) / zfe.d((double)var11, (double)var11);
                        }

                        return new zyy(var9);
                     }
                  }
               } else {
                  return zze.a;
               }
            case 302:
            case 542:
               if (var5[0] >= 0.0D && var5[1] > 0.0D && var5[2] > 0.0D) {
                  return new zyy(zfe.b(var5[0], var5[1], var5[2], var7[0]));
               }

               return zze.a;
            case 500:
               return new zyy(zaor.a(var5[0], 0.0D, 1.0D, var7[0]));
            case 507:
               return zfe.a(var5[0], var5[1], var7[0]);
            case 516:
               return zfe.a(var5[0], (double)((long)var5[1]), (double)((long)var5[2]), var7[0]);
            case 523:
               return zfe.a(var5[0], var5[1], var5[2], var5[3]);
            case 524:
               if (var5[0] > 0.0D && var5[2] > 0.0D) {
                  return new zyy(zaor.b((Math.log(var5[0]) - var5[1]) / var5[2]));
               }

               return zze.a;
            case 528:
               if (var5[0] >= 0.0D && var5[1] >= 0.0D && var5[2] >= 0.0D && var5[2] <= 1.0D) {
                  double var8 = 1.0D - var5[2];
                  double var10 = Math.pow(var5[2], var5[1]);

                  for(double var12 = 0.0D; var12 < var5[0]; ++var12) {
                     var10 *= (var12 + var5[1]) / (var12 + 1.0D) * var8;
                  }

                  return new zyy(var10);
               }

               return zze.a;
            default:
               return null;
            }
         }
      }
   }

   public static zagu a(int var0, zagu[] var1, zaay var2, int var3) {
      String[] var4 = new String[var3];
      zyz var5 = zaaq.a(var1, var2, 0, (String[])var4);
      if (var5 != null) {
         return var5;
      } else {
         String var6;
         switch(var0) {
         case 32:
            return new zyy((double)var4[0].length());
         case 112:
            return new zaam(var4[0].toLowerCase());
         case 113:
            return new zaam(var4[0].toUpperCase());
         case 114:
            return new zaam(zff.a(var4[0]));
         case 117:
            return var4[0].equals(var4[1]) ? zyx.a : zyw.a;
         case 118:
            return new zaam(zff.b(var4[0]));
         case 121:
            if (var4[0].length() < 1) {
               return zzg.a;
            }

            return new zyy((double)var4[0].charAt(0));
         case 162:
            return new zaam(zff.c(var4[0]));
         case 211:
            return new zyy((double)zff.a(var4[0].toCharArray()));
         case 385:
            var6 = zev.c(var4[0]);
            if (var6 == null) {
               return zze.a;
            }

            return new zyy(com.aspose.cells.b.a.zn.a(zev.a(var6, 16, 10)));
         case 392:
            var6 = zev.b(var4[0]);
            if (var6 == null) {
               return zze.a;
            }

            return new zyy(com.aspose.cells.b.a.zn.a(zev.a(var6, 8, 10)));
         case 393:
            var6 = zev.a(var4[0]);
            if (var6 == null) {
               return zze.a;
            }

            return new zyy(com.aspose.cells.b.a.zn.a(zev.a(var6, 2, 10)));
         default:
            return null;
         }
      }
   }

   public static zagu b(int var0, zagu[] var1, zaay var2, int var3) {
      zmf[] var4 = new zmf[var3];
      zyz var5 = zaaq.a(var1, var2, 0, (zmf[])var4);
      if (var5 != null) {
         return var5;
      } else {
         switch(var0) {
         case 396:
            return new zaam(com.aspose.cells.b.a.zr.a(var4[0].b(var4[1])));
         case 397:
            return new zaam(com.aspose.cells.b.a.zr.a(var4[0].d(var4[1])));
         case 398:
         default:
            return null;
         case 399:
            return new zyy(var4[0].d());
         case 400:
            return new zaam(com.aspose.cells.b.a.zr.a(var4[0].f()));
         case 401:
            return new zaam(com.aspose.cells.b.a.zr.a(var4[0].e()));
         case 402:
            return new zaam(com.aspose.cells.b.a.zr.a(var4[0].e().c(new zmf(com.aspose.cells.b.a.zq.a(2.718281828459045D, 2.0D), 0.0D))));
         case 403:
            return new zaam(com.aspose.cells.b.a.zr.a(var4[0].e().c(new zmf(Math.log10(2.718281828459045D), 0.0D))));
         case 404:
            return new zaam(com.aspose.cells.b.a.zr.a(var4[0].g()));
         case 405:
            return new zaam(com.aspose.cells.b.a.zr.a(var4[0].h()));
         case 406:
            return new zaam(com.aspose.cells.b.a.zr.a(var4[0].i()));
         case 407:
            return new zyy(var4[0].j());
         case 408:
            return new zaam(com.aspose.cells.b.a.zr.a(var4[0].k()));
         case 409:
            return new zyy(var4[0].b());
         case 410:
            return new zyy(var4[0].a());
         }
      }
   }

   public static zagu a(int var0, zagu var1, zaay var2) {
      var1 = var1.e(var2);
      switch(var1.b()) {
      case 0:
         return var1;
      case 2:
         zyy var3 = zaaq.b(((zaam)var1).k(), var2);
         if (var3 != null) {
            switch(var0) {
            case 140:
               return new zyy((double)((int)var3.k()));
            case 141:
               return new zyy(var3.k() - (double)((int)var3.k()));
            }
         }
      default:
         return zzg.a;
      }
   }

   public static zagu a(int var0, zagu[] var1, zaay var2, int var3, int var4, int var5) {
      String[] var6 = new String[var3];
      zyz var7 = zaaq.a(var1, var2, 0, (String[])var6);
      if (var7 != null) {
         return var7;
      } else {
         double[] var8 = new double[var4];
         var7 = zaaq.a(var1, var2, var3, var8, var5);
         if (var7 != null) {
            return var7;
         } else {
            String[] var9;
            int var10;
            int var15;
            switch(var0) {
            case 30:
               if (var8[0] < 0.0D) {
                  return zzg.a;
               } else {
                  var15 = (int)var8[0];
                  if (var6[0].length() * var15 > 32767) {
                     return zzg.a;
                  } else {
                     if (var6[0].length() < 1) {
                        return new zaam("");
                     }

                     char[] var16 = new char[var6[0].length() * var15];
                     char[] var17 = var6[0].toCharArray();

                     for(int var18 = 0; var18 < var15; ++var18) {
                        System.arraycopy(var17, 0, var16, var18 * var17.length, var17.length);
                     }

                     return new zaam(new String(var16));
                  }
               }
            case 31:
               if (var8[0] >= 1.0D && var8[1] >= 0.0D) {
                  var15 = (int)var8[0];
                  var10 = (int)var8[1];
                  --var15;
                  if (var10 > 0 && var15 < var6[0].length()) {
                     return new zaam(var6[0].substring(var15, var15 + Math.min(var10, var6[0].length() - var15)));
                  }

                  return new zaam("");
               }

               return zzg.a;
            case 119:
               if (var8[0] >= 1.0D && var8[1] >= 0.0D) {
                  var9 = new String[1];
                  var7 = zaaq.a(var1, var2, 3, (String[])var9);
                  if (var7 != null) {
                     return var7;
                  }

                  var10 = (int)var8[0];
                  int var11 = (int)var8[1];
                  if (var10 > var6[0].length()) {
                     return new zaam(var6[0] + var9[0]);
                  }

                  --var10;
                  if (var10 + var11 < var6[0].length()) {
                     char[] var12 = var6[0].toCharArray();
                     char[] var13 = var9[0].toCharArray();
                     char[] var14 = new char[var12.length - var11 + var13.length];
                     if (var10 > 0) {
                        System.arraycopy(var12, 0, var14, 0, var10);
                     }

                     System.arraycopy(var13, 0, var14, var10, var13.length);
                     System.arraycopy(var12, var10 + var11, var14, var10 + var13.length, var12.length - var10 - var11);
                     return new zaam(new String(var14));
                  }

                  return new zaam(var6[0].substring(0, 0 + var10) + var9[0]);
               }

               return zzg.a;
            case 207:
               if (var8[0] >= 1.0D && var8[1] >= 0.0D) {
                  var9 = new String[1];
                  var7 = zaaq.a(var1, var2, 3, (String[])var9);
                  if (var7 != null) {
                     return var7;
                  }

                  return new zaam(zff.a(var6[0], (int)var8[0], (int)var8[1], var9[0]));
               }

               return zzg.a;
            case 210:
               if (var8[0] >= 1.0D && var8[1] >= 0.0D) {
                  return new zaam(zff.a(var6[0], (int)var8[0], (int)var8[1]));
               }

               return zzg.a;
            default:
               return null;
            }
         }
      }
   }

   public static zagu c(int var0, zagu[] var1, zaay var2, int var3) {
      boolean[] var4 = new boolean[var3];
      zyz var5 = zaaq.a(var1, var2, 0, (boolean[])var4);
      if (var5 != null) {
         return var5;
      } else {
         return var4[0] ? zyw.a : zyx.a;
      }
   }

   public static zagu a(zagu[] var0, zaay var1) {
      zmf[] var2 = new zmf[1];
      zyz var3 = zaaq.a(var0, var1, 0, (zmf[])var2);
      if (var3 != null) {
         return var3;
      } else {
         double[] var4 = new double[1];
         var3 = zaaq.a(var0, var1, 1, (double[])var4, 7);
         if (var3 != null) {
            return var3;
         } else {
            return (zagu)(var2[0].a() == 0.0D && var2[0].b() == 0.0D && var4[0] < 0.0D ? zze.a : new zaam(com.aspose.cells.b.a.zr.a(var2[0].c(var4[0]))));
         }
      }
   }

   public static zagu a(zagu var0, zagu var1, zaay var2) {
      Object var3 = null;
      int var4 = 14;
      var0 = var0.e(var2);
      switch(var0.b()) {
      case 0:
         return var0;
      case 1:
         var3 = var0.c();
         var4 = 3;
         break;
      case 2:
         zyy var5 = zaaq.a(((zaam)var0).k(), var2);
         if (var5 != null) {
            var3 = var5.k();
         } else {
            var3 = var0.c();
            var4 = 18;
         }
         break;
      case 3:
         var3 = var0.c();
         break;
      default:
         var3 = var0.c();
         if (var3 != null) {
            var4 = zamo.a(var3.getClass());
         }
      }

      String var9 = "";
      if (var1 != null) {
         var1 = var1.e(var2);
         if (var1.b() == 0) {
            return var1;
         }

         if (var1.b() == 1) {
            return zzg.a;
         }

         zaam var8 = var1.i(var2);
         if (var8 != null) {
            var9 = zyc.a(((zaam)var8).k(), var2.p.k, true);
         }
      }

      if (var3 == null) {
         var3 = 0.0D;
      }

      try {
         zxz var6 = var2.p.a(var9, var4, var3);
         return (zagu)(var6.e() ? zzg.a : new zaam(var6.h()));
      } catch (Exception var7) {
         return zzg.a;
      }
   }

   public static zagu a(zagu var0, zaay var1) {
      var0 = var0.e(var1);
      switch(var0.b()) {
      case 0:
      case 2:
         return var0;
      default:
         return zaam.a;
      }
   }

   public static zagu b(zagu var0, zaay var1) {
      var0 = var0.e(var1);
      switch(var0.b()) {
      case 0:
      case 3:
         return var0;
      case 1:
         return ((zyv)var0).k() ? zyy.b : zyy.a;
      case 2:
      default:
         return new zyy(0.0D);
      }
   }

   public static zagu c(zagu var0, zaay var1) {
      var0 = var0.e(var1);
      switch(var0.b()) {
      case 0:
      case 3:
         return var0;
      case 2:
         zyy var2 = zaaq.a(((zaam)var0).k(), var1);
         if (var2 != null) {
            return var2;
         }
      default:
         return zzg.a;
      case 12:
         return zyy.a;
      }
   }

   public static zagu d(zagu var0, zaay var1) {
      if (var0.b() == 6) {
         return new zyy(64.0D);
      } else {
         var0 = var0.e(var1);
         switch(var0.b()) {
         case 0:
            return new zyy(16.0D);
         case 1:
            return new zyy(4.0D);
         case 2:
            return new zyy(2.0D);
         case 3:
         case 12:
            return zyy.b;
         case 4:
         case 5:
         case 6:
         case 7:
         case 8:
         case 9:
         case 10:
         case 11:
         default:
            return zyy.a;
         }
      }
   }

   public static zagu e(zagu var0, zaay var1) {
      var0 = var0.e(var1);
      return (zagu)(var0.b() == 0 ? ((zyz)var0).l() : zzb.a);
   }

   public static zagu a(boolean var0, zagu var1, zaay var2) {
      var1 = var1.d(var2);
      switch(var1.b()) {
      case 0:
         return var1;
      case 1:
      case 2:
      case 4:
      case 5:
      case 7:
      case 8:
      default:
         return zzg.a;
      case 3:
         return new zyy(1.0D);
      case 6:
         return new zyy(var0 ? (double)((zys)var1).k() : (double)((zys)var1).l());
      case 9:
         zaye var3 = ((zaal)var1).k();
         return new zyy((double)(var0 ? var3.f() - var3.b() : var3.h() - var3.d()) + 1.0D);
      }
   }

   public static zyv b(int var0, zagu var1, zaay var2) {
      if (var0 == 105) {
         var1 = var1.d(var2);
         return var1.b() == 9 ? zyx.a : zyw.a;
      } else {
         var1 = var1.e(var2);
         switch(var0) {
         case 2:
            return var1.b() == 0 && ((zyz)var1).k() == zst.c ? zyx.a : zyw.a;
         case 3:
            return var1.b() == 0 ? zyx.a : zyw.a;
         case 126:
            return var1.b() == 0 && ((zyz)var1).k() != zst.c ? zyx.a : zyw.a;
         case 127:
            return var1.b() == 2 ? zyx.a : zyw.a;
         case 128:
            return var1.b() == 3 ? zyx.a : zyw.a;
         case 129:
            return var1.b() == 12 ? zyx.a : zyw.a;
         case 198:
            return var1.b() == 1 ? zyx.a : zyw.a;
         default:
            return zyw.a;
         }
      }
   }

   public static zagu f(zagu var0, zaay var1) {
      var0 = var0.d(var1);
      switch(var0.b()) {
      case 0:
         return var0;
      case 5:
         zzl var2 = (zzl)var0;
         if (var2.k()) {
            return f((zaaj)var2, var1);
         } else {
            zaag var3 = (zaag)var0;
            zagu var4 = f(var3.m(), var1);
            if (var4.b() == 0) {
               return var4;
            } else {
               double var5 = ((zyy)var4).k();
               var4 = f(var3.m(), var1);
               if (var4.b() == 0) {
                  return var4;
               }

               return new zyy(var5 + ((zyy)var4).k());
            }
         }
      case 9:
         return zyy.b;
      default:
         return zyy.a;
      }
   }

   public static zagu c(int var0, zagu[] var1, zaay var2) {
      double[] var3 = new double[2];
      zyz var4 = zaaq.a(var1, var2, 0, (double[])var3, 7);
      if (var4 != null) {
         return var4;
      } else {
         double var5 = var3[0];
         long var7 = (long)var5;
         if (var7 >= 0L && var7 <= 281474976710655L && (double)var7 == var5) {
            var5 = var3[1];
            long var9 = (long)var5;
            if (var9 >= 0L && var9 <= 281474976710655L && (double)var9 == var5) {
               Object var11 = null;
               switch(var0) {
               case 490:
                  return zaaq.a(var7 & var9);
               case 491:
                  return zaaq.a(var7 | var9);
               case 492:
                  return zaaq.a(var7 ^ var9);
               default:
                  return zzc.a;
               }
            } else {
               return zze.a;
            }
         } else {
            return zze.a;
         }
      }
   }

   public static zagu a(zagu[] var0, zaay var1, boolean var2) {
      double[] var3 = new double[2];
      zyz var4 = zaaq.a(var0, var1, 0, (double[])var3, 7);
      if (var4 != null) {
         return var4;
      } else {
         double var5 = var3[0];
         long var7 = (long)var5;
         if (var7 >= 0L && var7 <= 281474976710655L && (double)var7 == var5) {
            var5 = var3[1];
            int var9 = (int)var5;
            if (Math.abs(var9) > 53) {
               return zze.a;
            } else {
               Object var10 = null;
               return var2 ? zaaq.a(var7 << var9) : zaaq.a(var7 >> var9);
            }
         } else {
            return zze.a;
         }
      }
   }
}
